package yannan.voiplock4ble.task;

import android.util.Log;

import org.greenrobot.eventbus.EventBus;

import java.util.TimerTask;

import yannan.voiplock4ble.BuildConfig;
import yannan.voiplock4ble.base.MyEnum;

/**
 * 说明：定时退出应用类
 * 作者：mainTel
 * 时间：2016/12/15 18:03
 * 备注：
 */
public class OutLogTimer extends TimerTask {

    long time;

    public static OutLogTimer create(long time) {
        OutLogTimer timer = new OutLogTimer();
        timer.time = time;
        return timer;
    }
    
    @Override
    public void run() {
        if (System.currentTimeMillis() - time > 60 * 1000 * 60) {
//            EventBus.getDefault().post(MyEnum.OutLog.OUT_LOG.toString());
            if (BuildConfig.DEBUG) Log.e("OutLogTimer", "退出应用啦");
        }
    }

    public void setTime(long time) {
        this.time = time;
    }
}
